import { list, edit, add, del, all, agentMenu, agentParkMenu, yardParkmenu } from "@/api/purview/role";
import store from "@/utils/store/cache"
// 角色管理
export const actions = {
    //  列表
    list(context: any, params: any) {
        return list(params)
    },
    //  编辑
    edit(context: any, params: any) {
        return edit(params)
    },
    //  新增
    add(context: any, params: any) {
        return add(params)
    },
    //  删除
    del(context: any, params: any) {
        return del(params)
    },
    // 全部
    all(context: any, isReLoad = false) {
        store.loadCacheDataByFun(context, 'all', all, null, { isReLoad });
    },
    // 代理商菜单
    agentMenu(context: any, params: any, isReLoad = true) {
      return store.loadCacheDataByFun(context, 'agentMenu', agentMenu, params, { isReLoad });
    },
    // 代理商给园区分配菜单
    agentParkMenu(context: any, params: any, isReLoad = true) {
        return store.loadCacheDataByFun(context, 'agentParkMenu', agentParkMenu, params, { isReLoad });
    },
    // 园区菜单
    yardParkmenu(context: any) {
        store.loadCacheDataByFun(context, 'yardParkmenu', yardParkmenu);
    }
}
